//
//  MyOrderVC.m
//  BigJoy
//
//  Created by Rowling on 2017/7/12.
//  Copyright © 2017年 Rowling. All rights reserved.
//

#import "MyOrderVC.h"
#import "OrderDetailVC.h"
#import "choseTakePhotoVIew.h"
@interface MyOrderVC ()
@property (weak, nonatomic) IBOutlet UIView *contentView;

@end

@implementation MyOrderVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.contentView addSubview:self.XMTableview];
    self.XMTableview.estimatedRowHeight = 240;
    self.baseDataArray = @[@1,@2,@3,@4,@4,@3,@2,@1,@5,@3,@3];
}

-(void)viewWillAppear:(BOOL)animated {
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

-(void)viewWillDisappear:(BOOL)animated {
    [self.navigationController setNavigationBarHidden:NO animated:YES];

}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    WaitDispatchCell * cell = [WaitDispatchCell cellWithTalbelView:tableView];
    cell.cellType = self.cellType;
    cell.count = [self.baseDataArray[indexPath.row] integerValue];
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewAutomaticDimension;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    OrderDetailVC * vc = [OrderDetailVC new];
    [self.navigationController pushViewController:vc animated:YES];
}

- (IBAction)backButtonClick:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
// 全部分类选择
- (IBAction)allButtonClick:(UIButton *)sender {
    choseTakePhotoVIew * choseView = [[choseTakePhotoVIew alloc]initHeadWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) titleArray:@[@"全部",@"待支付",@"待发货",@"待收货",@"已完成",@"已取消"]];
    [XMKEYWINDOWXM addSubview:choseView];
    [choseView.subject subscribeNext:^(id  _Nullable x) {
        NSInteger tag = [x integerValue];
        NSLog(@"%ld",tag);
    }];
}

@end
